package edu.taru.pojo;

public class Menu {
    private Integer menuId;

    private String menuName;

    private String menuUrl;

    private String menuCode;

    @Override
    public String toString() {
        return "Menu{" +
                "menuId=" + menuId +
                ", menuName='" + menuName + '\'' +
                ", menuUrl='" + menuUrl + '\'' +
                ", menuCode='" + menuCode + '\'' +
                '}';
    }

    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    public Integer getMenuId() {
        return menuId;
    }

    public void setMenuId(Integer menuId) {
        this.menuId = menuId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName == null ? null : menuName.trim();
    }

    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl == null ? null : menuUrl.trim();
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null){
            return false;
        }
        if(this == obj){
            return true;
        }
        if(obj instanceof Menu){
            Menu menu = (Menu)obj;
            if(menu.menuId.equals(this.menuId)&&menu.menuName.equals(this.menuName)&&menu.menuUrl.equals(this.menuUrl)){
                return true;
            }
        }
        return false;
    }

    @Override
    public int hashCode() {
        return this.menuId.hashCode();
    }
}